import { defineStore } from "pinia";
import {ref} from 'vue'

export const useKuYiStore=defineStore('KuYi',()=>{
    const authToken=ref()
    
    const setToken=(newToken)=>{
        authToken.value=newToken     
    }

    // 清空token，当用户点击
    const removeToken=()=>{
        authToken.value=''   
    }

    // 楼宇数据
    const LouYu=ref([])
    const setLouYu=(value)=>{
        LouYu.value=value     
    }
    const removeLouYu = ()=>{
        LouYu.value=[]
    }

    return {
        authToken,
        setToken,
        removeToken,
        LouYu,
        setLouYu,
        removeLouYu
    }
},{
    persist:true
})


